package com.mobi.cacti.rabbit.connectors;

import java.io.IOException;
import java.security.KeyStore;

import org.apache.http.HttpResponse;
import org.apache.http.HttpVersion;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.BasicResponseHandler;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpParams;
import org.apache.http.params.HttpProtocolParams;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;

import com.mobi.cacti.rabbit.response.Cache;
import com.mobi.cacti.rabbit.utils.MySSLSocketFactory;

import android.os.AsyncTask;
import android.util.Log;

public class LoginActivityServerConnector  extends AbstractServerConnector{
	
	public void authenticateWithServer(String username, String password)
	{
		String url = "https://timonitorappuat.trueinternet.co.th/cactimobileservice/reqmobilelogina.php";
		String xmlData =
				"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
						"<ReqMobileLogin>" +
						"<ReqSessionID>"+Cache.getRequestSessionID()+"</ReqSessionID>" +
						"<AppUser>COMi</AppUser>" +
						"<AppPass>b5d864cdeb699ebb3d17a6ff70c3aa5e</AppPass>" +
						"<CactiUser>"+username+"</CactiUser>" +
						"<CactiPass>"+password+"</CactiPass>" +
						"</ReqMobileLogin>";
		
		this.execute(url,xmlData);

	}
	

}
